﻿using FSM;

namespace Procedure
{
    /// <summary>
    /// 流程状态基类
    /// </summary>
    public abstract class ProcedureBase : FsmState<IProcedureManager>
    {
        /// <summary>
        /// 状态初始化时调用
        /// </summary>
        /// <param name="produceOwner">流程持有者</param>
        protected internal override void OnInit(IFsm<IProcedureManager> produceOwner)
        {
            base.OnInit(produceOwner);
        }

        /// <summary>
        /// 进入状态时调用
        /// </summary>
        /// <param name="procedureOwner"></param>
        protected internal override void OnEnter(IFsm<IProcedureManager> procedureOwner)
        {
            base.OnEnter(procedureOwner);
        }

        /// <summary>
        /// 状态轮询时调用
        /// </summary>
        /// <param name="procedureOwner"></param>
        /// <param name="elapseSeconds"></param>
        /// <param name="realElapseSeconds"></param>
        protected internal override void OnUpdate(IFsm<IProcedureManager> procedureOwner,
            float elapseSeconds,
            float realElapseSeconds)
        {
            base.OnUpdate(procedureOwner, elapseSeconds, realElapseSeconds);
        }
        
        /// <summary>
        /// 离开状态时调用
        /// </summary>
        /// <param name="procedureOwner">流程持有者</param>
        /// <param name="isShutdown">是否是关闭状态机</param>
        protected internal override void OnLeave(IFsm<IProcedureManager> procedureOwner,
            bool isShutdown)
        {
            base.OnLeave(procedureOwner, isShutdown);
        }

        /// <summary>
        /// 状态销毁时调用
        /// </summary>
        /// <param name="procedureOwner">流程持有者</param>
        protected internal override void OnDestroy(IFsm<IProcedureManager> procedureOwner)
        {
            base.OnDestroy(procedureOwner);
        }
    }
}